package com.kamistoat.meimeimall.meimeimallmember.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.kamistoat.meimeimall.common.To.memberTo.MemberReceiveAddressTo;
import com.kamistoat.meimeimall.meimeimallmember.entity.MemberReceiveAddressEntity;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * 会员收货地址
 *
 * @author kamistoat
 * @email linjianshanke@163.com
 * @date 2021-09-12 16:36:46
 */
public interface MemberReceiveAddressService extends IService<MemberReceiveAddressEntity> {

    /**
     * 计算运费
     * @param attrId
     * @return
     */
    BigDecimal getFare(Long attrId);

    /**
     * 带缓查询用户收货地址列表。构造成To类返回
     */
    List<MemberReceiveAddressTo> getMemberReceiveAddressToList(Long memberId);

    /**
     * 带缓查询指定Id的收货地址To类
     */
    MemberReceiveAddressTo getReceiveAddressById(Long memberId, Long addrId);

    /**
     * 带缓删除一个指定的收获地址
     * @param memberId 用户Id
     * @param addressId 地址Id
     */
    void deleteOneAddress(Long memberId, Long addressId);

    /**
     * 带缓修改一个指定收获地址为默认地址
     * @param memberId 用户Id
     * @param addressId 地址Id
     */
    void setToDefault(Long memberId, Long addressId);

    /**
     * 带缓修改/新增一个收获地址
     * @param memberReceiveAddressTo
     */
    void addOrUpdateAddress(MemberReceiveAddressTo memberReceiveAddressTo);
}

